package com.xiaoxi.common.constant.enumeration.statuscode.system;

import com.xiaoxi.common.constant.enumeration.statuscode.ParentEnum;

import java.util.HashMap;
import java.util.Map;

/**
 * @author xiaoxi
 * @version 1.0
 * @date 2022/7/28 14:31
 */
public enum FileSystemEnums implements ParentEnum {

    FILE_IS_NULL("B980","文件为空"),
    FILE_STREAM_ERROR("B981","文件流出现错误"),
    PLEASE_CHECK_FILE_FORMAT("B982","请检查文件格式"),
    WRITE_EXCEPTION("B983","写入数据异常");


    private final String code;
    private final String message;

    FileSystemEnums(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    @Override
    public Map<String, String> format() {
        Map<String, String> enumData = new HashMap<>();
        enumData.put("code", this.code);
        enumData.put("message", this.message);
        return enumData;
    }
}
